package com.example.web.swagger;

import com.example.model.Department;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@Api(tags = "部门接口", produces = "application/json")
public interface IDepartmentController {

    @Operation(summary = "部门列表", description = "查询所有的部门信息", method = "GET")
    public List<Department> list();

    @Operation(summary = "单个部门信息", description = "根据 ID 查询指定的部门信息", method = "GET")
    public Department getDepartment(Long id);

    @Operation(summary = "添加部门信息", description = "添加部门信息", method = "POST")
    public Map<String, Object> addDepartment(
            @Parameter(in = ParameterIn.DEFAULT, description = "", schema = @Schema(implementation = Department.class)) Department department,
            @Parameter(in = ParameterIn.DEFAULT, description = "", required = true) @RequestParam(value = "aaa") String aaa,
            @Parameter(in = ParameterIn.DEFAULT, description = "", required = true) @RequestParam(value = "bbb") String bbb);
}
